@echo off

rem This scripts for "Regedit Operation"

rem  Query reg
set system_regedit_path="HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment"
set sys_var_path=Path
reg query %system_regedit_path% /v %sys_var_path% 1>nul 2>nul
if %errorlevel% == 0 (
    for /f "tokens=3 delims= " %%a in ('reg query %system_regedit_path% /v %sys_var_path%') do set old_sys_path=%%a
)
echo ENV %sys_var_path% value: %old_sys_path%


rem Set reg, by SETX，use "/m" for setting system env (need admin)
rem SETX can only set evn that "length < 1024"
setx TEST_ENV_FOR_USE "%add_sys_env_path%"
setx TEST_ENV_FOR_SYS "%add_sys_env_path%" /m


rem Set reg, by "reg create" "reg add"
